searchConsoleRgoogleAnalyticsRgoogleAuthR -> garglegoogleComputeEngineR (cloudyr)googleCloudStorageR (cloudyr)bigQueryR (cloudyr)googleLanguageR (rOpenSci)googleCloudRunner (New!)Slack: #googleAuthRverse
Docker - a container system for building and sharing applications
Cloud - computing delivered via the internet, not locally
Serverless - cloud services that often use containers to host applications without configuring servers
Flexible No need to ask IT to install R places, use docker run; across cloud platforms; ascendent tech
Version controlled No worries new package releases will break code
Scalable Run multiple Docker containers at once, fits into event-driven, stateless serverless future
Docker levels the playing ground between languages
https://www.rocker-project.org/
Maintain useful R images
rocker/r-verrocker/rstudiorocker/tidyverserocker/shinyrocker/ml-gpuFROM rocker/tidyverse:3.6.0
MAINTAINER Mark Edmondson (r@sunholo.com)
# install R package dependencies
RUN apt-get update && apt-get install -y \
libssl-dev
## Install packages from CRAN
RUN install2.r --error \
-r 'http://cran.rstudio.com' \
googleAuthR \
googleComputeEngineR \
googleAnalyticsR \
searchConsoleR \
googleCloudStorageR \
bigQueryR \
## install Github packages
&& installGithub.r MarkEdmondson1234/youtubeAnalyticsR \
## clean up
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \Demo an Rmd script pulling data from googlesheets
Demo a plumber script with Cloud Pub/Sub
Demo cloudbuild.yml building website via pkgdown
As easy as possible enabling of R use cases in the Cloud
Docker image originally for GCE, deployed to Kubernetes:
kubectl run shiny1 \
--image gcr.io/gcer-public/shiny-googleauthrdemo:prod \
--port 3838
kubectl expose deployment shiny1 \
--target-port=3838 --type=NodePorthttps://code.markedmondson.me/r-on-kubernetes-serverless-shiny-r-apis-and-scheduled-scripts/
Cloud Build (like the demo earlier - build Rmd on a schedule)
Cloud Run (like the demo earlier - trigger R code from events)
library(googleAnalyticsR)
#' Return output data from the ga_time_normalised ga_model
#' @param viewID The viewID for Google Analytics
#' @get /data
function(viewID=""){
model <- ga_time_normalised(viewID)
model$output
}
#' Plot out data from the ga_time_normalised ga_model
#' @param viewID The viewID for Google Analytics
#' @get /plot
#' @serializer htmlwidget
function(viewID=""){
model <- ga_time_normalised(viewID)
model$plot
}@serialiser htmlwidgets is great
http://gallery.htmlwidgets.org/